//
//  MNSystemHandler.swift
//  MeenoHybrid
//
//  Created by alyadan on 2016/12/23.
//  Copyright © 2016年 alyadan. All rights reserved.
//

import Foundation


class MNSystemHandler: HybridBaseHandler {
    
    override init(){
        super.init()
        name = "mnSystemHandler"
    }
    
    
    func updateDataModel(data: [String: Any], callback:BlockWarp) {
        
        guard let phoneNumber = data["phoneNo"] as? String else{
            callbackParamError(callback: callback.task)
            return
        }
        
        let url = URL(string: "tel://\(phoneNumber)")!
        if UIApplication.shared.canOpenURL(url){
            UIApplication.shared.openURL(url)
        }
    }
    
}
